home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 7.1 KB | 245 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Content.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CONTENT_H
- #define CONTENT_H
-
- #ifndef FWCONTNG_H
- #include "FWContng.h"
- #endif
-
- #ifndef CELL_H
- #include "Cell.h"
- #endif
-
- #ifndef CONSTANT_H
- #include "Constant.h"
- #endif
-
- #ifndef PROXY_H
- #include "Proxy.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class CTablePart;
- class CTableProxy;
- class FW_CView;
- class FW_CMouseEvent;
-
- //========================================================================================
- // class CTablePartContent
- //========================================================================================
-
- class CTablePartContent : public FW_CEmbeddingContent
- {
- public:
-
- FW_DECLARE_AUTO(CTablePartContent)
-
- friend class CTableProxysIterator;
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CTablePartContent(Environment* ev, CTablePart* part);
- virtual ~CTablePartContent();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- virtual void ExternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CPromise* promise,
- FW_CCloneInfo* cloneInfo);
- virtual FW_Boolean InternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
-
- virtual FW_MProxy* IsDataOnlyOneProxy(Environment* ev) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Hit testing -----
- ETableLoc HitTest(Environment* ev,
- const FW_CMouseEvent& theMouseEvent,
- FW_CView* view,
- CCell& cell) const;
- ETableLoc HitTest(Environment* ev,
- const FW_CPoint& where,
- CCell& cell) const;
-
- // ----- Resizing -----
- void Resize(Environment* ev,
- const CCell& cell,
- ETableLoc tl,
- const FW_CPoint& delta);
- void UpdateExtent(Environment* ev);
-
- // ----- Add/Remove proxys -----
- void AddProxy(CTableProxy* proxy);
- void RemoveProxy(CTableProxy* proxy);
- void DeleteProxy(Environment* ev, const CCell& cell);
-
- // ----- Getters/setters -----
- const CCell& GetMaxRowCol() const
- {return fMaxRowCol;}
-
- FW_Fixed GetCellSize(short c, FW_XYSelector direction) const;
- FW_Fixed GetWidth (short c) const;
- FW_Fixed GetHeight(short r) const;
-
- void SetWidth (short c, FW_Fixed w);
- void SetHeight(short r, FW_Fixed h);
-
- // ----- Coordinates from cell -----
- void FindCell(const FW_CPoint& where, CCell& cell) const;
-
- FW_Fixed FindLocation(short c, FW_XYSelector direction) const;
- FW_Fixed FindLeft(short col) const;
- FW_Fixed FindTop (short row) const;
-
- void FindRect(const CCell& cell,
- FW_CRect& rect) const;
-
- // ----- Cell -> proxy
- CTableProxy* CellToProxy(const CCell& cell) const;
-
- FW_CPoint GetExtent() const
- {return fExtent;}
-
-
- void AllocateArrays();
- void DisposeArrays();
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- CTablePart* fTablePart;
- CTableProxyCollection* fProxys;
-
- // ----- Current size in memory -----
- CCell fMaxRowCol;
- FW_CPoint fExtent;
-
- // ----- Width and height of cells -----
- FW_Fixed* fWidth;
- FW_Fixed* fHeight;
- };
-
- //========================================================================================
- // class CTableProxysIterator
- //========================================================================================
-
- class CTableProxysIterator : public CTableProxyCollectionIterator
- {
- public:
- FW_DECLARE_AUTO(CTableProxysIterator)
-
- CTableProxysIterator(CTablePartContent* content) :
- CTableProxyCollectionIterator(content->fProxys){}
- ~CTableProxysIterator() {}
- };
-
- //========================================================================================
- // class CTableSelectionContent
- //========================================================================================
-
- class CTableSelectionContent : public FW_CEmbeddingContent
- {
- public:
-
- FW_DECLARE_AUTO(CTableSelectionContent)
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CTableSelectionContent(Environment* ev, CTablePart* part, CTablePartContent* content);
- virtual ~CTableSelectionContent();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_MProxy* IsDataOnlyOneProxy(Environment* ev) const;
-
- virtual void ExternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CPromise* promise,
- FW_CCloneInfo* cloneInfo);
-
- virtual FW_Boolean InternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
-
- virtual void SingleEmbeddedFrameInternalized(Environment* ev,
- FW_CEmbeddingFrame* scopeFrame,
- ODPart* embeddedPart,
- ODFrame* embeddedFrame,
- ODShape* suggestedShape,
- ODTypeToken viewType);
-
- virtual ODShape* AcquireSuggestedFrameShape(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Getters/Setters -----
- CCell GetCell() const;
- void SetCell(const CCell& cell);
-
- CTableProxy* GetSelectedProxy(Environment* ev) const;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CTablePartContent* fTableContent;
- CTablePart* fTablePart;
- CCell fCell;
- };
-
- //========================================================================================
- // Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::GetCell
- //----------------------------------------------------------------------------------------
- inline CCell CTableSelectionContent::GetCell() const
- {
- return fCell;
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::SetCell
- //----------------------------------------------------------------------------------------
- inline void CTableSelectionContent::SetCell(const CCell& cell)
- {
- fCell = cell;
- }
-
-
- #endif